package com.cnap.model.intelligent;

/**
 * <类文件描述>
 *
 * @author xc
 **/
public enum IntelligentResultEnum {
    // 已优化
    OPTIMIZED(2, "已优化"),
    // 待优化
    TO_BE_OPTIMIZED(1, "待优化"),
    // 无需优化
    NO_OPTIMIZATION_REQUIRED(0, "无需优化");
    private final int status;
    private final String msg;

    IntelligentResultEnum(int status, String msg) {
        this.status = status;
        this.msg = msg;
    }

    /**
     * get
     *
     * @return Status
     */
    public int getStatus() {
        return status;
    }

    /**
     * get
     *
     * @return Msg
     */
    public String getMsg() {
        return msg;
    }

    /**
     * 根据状态获取msg
     *
     * @param status status
     * @return msg
     */
    public static String msgByStatus(int status) {
        IntelligentResultEnum[] resultEnums = IntelligentResultEnum.values();
        for (IntelligentResultEnum resultEnum : resultEnums) {
            if (resultEnum.getStatus() == status) {
                return resultEnum.getMsg();
            }
        }
        return "";
    }
}
